<template>
    <div class='folder'>
         <div class='content_item' v-for="(item,index) in desktop" :key="index" v-on:click="openWin(item)">
                <img :src='item.icon'>
                <div>{{item.text}}</div>
            </div>
    </div>
</template>
<script>
import Vue  from 'vue'
export default {
    name: 'folder', 
    components: {
   
    },
    data(){
        return{
            desktop:[],
            id:''
        }
    },
    beforeCreate(){
        document.title="深蓝系统"; 
        /**初始化窗口数量 */
        
    },
    created(){
        let sef=this;
        this.id = this.$route.query.id;
        let imgIp=localStorage.getItem("imgIp")
        /**获取桌面模块，目前定义所有的模块显示，没有设置自主模块 */
        this.$post('apiServe/getUserModelsByVue',{modelId:this.id}).then(res=>{
            console.log(res)
            let nav=res[0].nav;
            sef.desktop=[];
            for(let i=0;i<nav.length;i++){
                let n=nav[i];
                n.icon=imgIp+n.icon;
                sef.desktop.push(n);
            }
        });
        
        
        
    },
    methods:{
        openWin(item){
            parent.postMessage(JSON.stringify(item),'*');
        }
    }
}
</script>
<style scoped  src="../../assets/css/win10/folder.css">
</style>
